import {createWebHistory, createRouter} from "vue-router";
import Home from "@/views/Home.vue";
import ArticleDetail from "@/views/ArticleDetail.vue";
import Login from "@/views/Login.vue";
import UserCenter from "@/views/UserCenter.vue";
import ArticleCreate from "@/views/ArticleCreate.vue";
import ArticleEdit from "@/views/ArticleEdit.vue";
import About from "@/views/About.vue";
import TimeLine from "@/views/TimeLine.vue";
import Photo from "@/views/Photo.vue";
import Topic from "@/views/Topic.vue";
import Essay from "@/views/Essay.vue";
import Story from "@/views/Story.vue";
import Design from "@/views/Design.vue";
import Web from "@/views/Web.vue";
import Crawler from "@/views/Crawler.vue";
import Go from "@/views/Go.vue";

const routes = [
    {
        path: "/",
        name: "Home",
        component: Home,
        meta: {
            title: "我与春风结过客"
        }
    },
    {
        path: "/article/:id",
        name: "ArticleDetail",
        component: ArticleDetail,
        meta: {
            title: "详情页"
        }
    },
    {
        path: "/login",
        name: "Login",
        component: Login,
        meta: {
            title: "登录"
        }
    },
    {
        path: "/user/:username",
        name: "UserCenter",
        component: UserCenter,
    },
    
    {
        path: "/article/create",
        name: "ArticleCreate",
        component: ArticleCreate
    },
    {
        path: "/article/edit/:id",
        name: "ArticleEdit",
        component: ArticleEdit,
        meta: {
            title: "编辑"
        }
    },
    {
        path: "/about",
        name: "About",
        component: About,
        meta: {
            title: "About"
        }
    },
    {
        path: "/timeline",
        name: "TimeLine",
        component: TimeLine,
        meta: {
            title: "TimeLine"
        }
    },
    {
        path: "/photo",
        name: "Photo",
        component: Photo,
        meta: {
            title: "Photo"
        }
    },
    {
        path: "/topic",
        name: "Topic",
        component: Topic,
        meta: {
            title: "Topic"
        }
    },
    {
        path: "/essay",
        name: "Essay",
        component: Essay,
        meta: {
            title: "Essay"
        }
    },
    {
        path: "/story",
        name: "Story",
        component: Story,
        meta: {
            title: "Story"
        }
    },
    {
        path: "/design",
        name: "Design",
        component: Design,
        meta: {
            title: "Design"
        }
    },
    {
        path: "/web",
        name: "Web",
        component: Web,
        meta: {
            title: "Web"
        }
    },
    {
        path: "/crawler",
        name: "Crawler",
        component: Crawler,
        meta: {
            title: "Crawler"
        }
    },
    {
        path: "/go",
        name: "Go",
        component: Go,
        meta: {
            title: "Go"
        }
    },
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;